<template>
	<view>
		<!-- 人脸核身流程的url -->
		<web-view v-if="url" :src="url"></web-view>
	</view>
</template>

<script>
	import { get_authority_config } from '@/api/new_api.js'
	export default {
		data() {
			return {
				url: ''
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			// 需要手机预览调试！！！！！！！！开发工具无权限！！！
			async init() {
				uni.showLoading({
					title: '加载中...'
				})
				let message = ''
				try{
					const {status, msg, data} = await get_authority_config()
					message = msg
					if(status == 200) {
						const { Response } = data
						this.url = Response.Url
						uni.hideLoading()
						return
					}
				}catch(e){
					//
					console.log('fail', e);
					message = e.msg
				}
				uni.hideLoading()
				uni.showModal({
					content: message || '网络错误，请稍后重试',
					showCancel: false,
					confirmText: '好的',
					success: (res)=> {
						uni.navigateBack()
					}
				});
			}
		}
	}
</script>

<style>

</style>
